//
//  Player.swift
//  SwiftUIState
//
//  Created by 李煜 on 2024/7/31.
//

import SwiftUI

struct Player: View {
  @State private var isPlaying = false
  var body: some View {
    Button(action: {
      isPlaying.toggle()
    }, label: {
      Image(systemName: isPlaying ? "stop.circle.fill" : "play.circle.fill")
        .font(.system(size: 150))
        .foregroundStyle(isPlaying ?  .red : .green)
    })
  }
}

#Preview {
    Player()
}
